class Test{
    Test(){
        System.out.println("创建对象调用Test构造器方法");
    }
    void TestBreak(){
        int [] i={1,2,3,4,5,6};
        for (int z: i){//break 终止循环跳出不再执行
            if (z==5)break;
            System.out.print(z);
            System.out.print(",");
        }
    }

    void TestContinue(){//continue 理解 在loop function里面触发后 跳出本次循环 继续执行循环
        int [] i={1,2,3,4,5,6};
        for (int z: i){
            if (z==5)continue;
            System.out.print(z);
            System.out.print(",");
        }
    }
}
public class TestZqFor extends  Test{

    public static void main(String[] args){
        TestZqFor myTestBreak =  new TestZqFor();// new obj 需要类型一致
        myTestBreak.TestBreak();
        System.out.println();
        myTestBreak.TestContinue();
        System.out.println();
        int [] numbers={1,2,3,4,5,6};
        for (int x :numbers){//针对数组的增强for 可以来遍历数组元素
            System.out.print(x);
            System.out.print(",");
        }
        System.out.println();
        String [] names={"jack","Tommy","Goliser","Breze_Stars"};
        for (String y:names){
            System.out.print(y);
            System.out.print(",");
        }
    }
}
